home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / doc / wedge.doc < prev    next >
Text File  |  1994-02-13  |  24KB  |  609 lines

  1.  
  2.                 WEDGE
  3.  
  4. Format: WEDGE <library> <offset> [regs ptrs] [opt fklnprasxz u t=<tasklist>
  5.         b=<baud> c=<comment> d=<n>]
  6.     or  WEDGE LIST
  7.     or  WEDGE KILLALL
  8.  
  9. Template: WEDGE "LIBRARY,OFFSET,REGS/K,PTRS/K,OPT/S,T=/K,B=/K,C=/K,D=/K"
  10.  
  11. Purpose: To monitor calls to any library function.
  12.  
  13. Specification:
  14.  
  15. WEDGE allows you to monitor the library function calls of system and
  16. application tasks.  This is useful for both debugging and the optimization
  17. of software. WEDGE reports the name and address of the task calling the
  18. function, the Forbid/Disable status, the register contents, data pointed to
  19. by registers, stack, and the function return value.
  20.  
  21. You can restrict reporting to a list of tasks, and you can also exclude a
  22. list of tasks from reporting.  When in serial mode, Debug (ROMWACK) can be
  23. invoked either before or after the WEDGEd function.
  24.  
  25. Wedge 37.1 adds SegTracker support, and reduced stack usage.
  26. (older versions of wedge can cause stack overflow crashes under
  27. 2.1 and higher OS when locale.library is present).
  28.  
  29. NOTE - The new Software Tools LVO command has a "wedgeline" option which
  30. can be used with the Amiga FD files to automatically create command lines
  31. for WEDGE.  This is the easiest way to create a basic command line for
  32. WEDGE - much easier than figuring out the register bit patterns yourself.
  33. See the final section on creating your own wedges for more information.
  34.  
  35.  
  36. EXPLANATION OF WEDGE ARGUMENTS
  37.  
  38. In this section, the CLI argument is listed followed by the Workbench TOOL
  39. TYPE enclosed in parentheses.  If an example is included to illustrate an
  40. argument, the example shows both the CLI argument and the corresponding TOOL
  41. TYPE.
  42.  
  43.  
  44. Required Arguments (ToolTypes shown in parentheses)
  45.  
  46. NOTE - All command line options should be lower-case
  47.  
  48. <library> (LIBRARY=)    Specifies any run-time library (without the
  49.             ".library" suffix).
  50.  
  51.             Example:    exec        (LIBRARY=exec)
  52.  
  53.  
  54. <offset>  (OFFSET=)    Specifies the library base offset of the function
  55.             being WEDGEd.  It must be expressed as a negative
  56.             offset in hexadecimal form.
  57.  
  58.             Example:    0xff28    (OFFSET=0xff28)
  59.  
  60.  
  61. Optional Argument Pair
  62.  
  63. NOTE:  REGS and PTRS must be used in conjunction with each other.  If you
  64.        supply one option, you MUST supply the other.  They cannot be used
  65.        alone.
  66.  
  67. <regs>    (REGS=)        Hexadecimal word (format 0xHHHH) representing the
  68.             registers that should be reported.  Each bit set in
  69.             the word represents a 68000 register, with the bits
  70.             from right to left, representing d0 through d7 then
  71.             a0 through a7.
  72.  
  73.             Example: To monitor d0, d1, a0 and a6, the bit
  74.                  pattern would be:
  75.  
  76.                                          a6        a0    d1  d0
  77.                                           \        /      \  /
  78.                                  Binary:  0100 0001 0000 0011
  79.  
  80.                              Then convert binary nibbles to hexadecimal:
  81.  
  82.                                   Binary<>Hex Conversion Table
  83.  
  84.                                  0000=0  0100=4  1000=8  1100=C
  85.                                  0001=1  0101=5  1001=9  1101=D
  86.                                  0010=2  0110=6  1010=A  1110=E
  87.                                  0011=3  0111=7  1011=B  1111=F
  88.  
  89.                  This example converted to hex is
  90.  
  91.                                               HEX 4 1 0 3
  92.  
  93.                                  The regs argument would be:
  94.  
  95.                  0x4103        (REGS=0x4103)
  96.  
  97.  
  98. <ptrs>    (PTRS=)    The hex word (format 0xHHHH) representing the
  99.             monitored registers that point to the data you want
  100.             reported.  This is especially useful for monitoring
  101.             text strings passed as function arguments. The first
  102.             16 bytes of the data will be reported in both hex
  103.             and ASCII.  The hex word is formed the same way as
  104.             for the REGS option.
  105.  
  106.             Example:  If d1 and a0 are pointers:
  107.                     0x0102    (PTRS=0x0102)
  108.  
  109.  
  110.  
  111. f      (FORBID=TRUE)    Causes WEDGE to Forbid() before calling the WEDGEd
  112.             function.  WEDGE will not call Permit() until Result
  113.             is returned.  This flag is only meaningful if Result
  114.             reporting is in effect.  When you are monitoring
  115.             tasks that are calling the same functions, this flag
  116.             can help to synchronize Result reports with other
  117.             WEDGE output by attempting to prevent multitasking
  118.             until the function returns.  Functions that Wait()
  119.             and local output will break this Forbid().
  120.  
  121.  
  122. k    (KILL=TRUE)    Kills this WEDGE.  Use KILL=TRUE for a kill-only
  123.             icon.  Use KILL=FALSE for an install-only icon.  If
  124.             a KILL TOOL TYPE is not present, the icon will
  125.             toggle WEDGE in and out.)
  126.  
  127.  
  128. l      (LOCAL=TRUE)    Selects studio reporting.  In this mode, WEDGE can
  129.             only report the function calls of non-FORBIDden
  130.             processes with available stack of at least 1800
  131.             bytes.  (Only 300 bytes are needed for serial or
  132.             parallel output.)  In addition, function calls made
  133.             by the Local output handler will not be reported.
  134.             (The Local output handler is usually a window, but
  135.             it may be another handler if CLI output redirection
  136.             was used.)
  137.  
  138.             In all output modes, WEDGE will bypass reporting if
  139.             the caller's available stack is too low for safe
  140.             execution of the output function.  All unreported
  141.             calls are tallied, and a count is presented at the
  142.             next report. The available stack safety feature may
  143.             be turned off (at your own risk) with the UNSAFE
  144.             TOOL TYPE or with the CLI 'U' flag.
  145.  
  146.  
  147. n    (NOISY=TRUE)    Notifies user of WEDGE installation and removal.
  148.  
  149.  
  150. p    (PARALLEL=TRUE) Selects parallel reporting, instead of serial.  By
  151.             default, all debugging output is directed to the
  152.             serial port and may be received by a terminal,
  153.             serial printer or a second computer running terminal
  154.             software.  Optionally, the output can be directed to
  155.             the parallel port or displayed locally.
  156.  
  157.  
  158. r    (RESULT=TRUE)   Monitors the return value of reported functions. An
  159.             Id number is assigned to each reported function
  160.             call.  That call's Return value report is tagged
  161.             with the same Id number. This allows you to match
  162.             calls and return values, even if multitasking causes
  163.             other WEDGE reports to be output in between them.
  164.  
  165. a    (RESULTP=TRUE)    Monitors what the result points to.
  166.  
  167.  
  168. s    (STACK=TRUE)    Monitors stack limits and pointer.
  169.  
  170.  
  171. x    (EXCLUDE=TRUE)    Excludes tasks in the tasklist from reporting.
  172.  
  173.  
  174. u    (UNSAFE=TRUE)    Reports regardless of the available stack.  Use this
  175.             option at your own risk.  When WEDGE is run from the
  176.             CLI, the U flag may not be grouped with other flags
  177.             (there must be a space before it).
  178.  
  179.  
  180. z    (ZAP=TRUE)    When used in conjunction with the k option, z lets
  181.             you force the unloading of a WEDGE that is still in
  182.             use.  Generally this is a very dangerous thing to
  183.             do.  But, occasionally, it is necessary because a
  184.             WEDGE that is unWEDGEd with kill will not be
  185.             unloaded if there is still an "occupant" in the
  186.             WEDGE. This can occur if you have WEDGEd Wait() with
  187.             Result reporting, and a task calls Wait(0), which
  188.             will never Return.  In this case, you can use the z
  189.             option to force the unloading of the Wait() WEDGE.
  190.             Note:  A new WEDGE may not be installed in a
  191.             function if an old one has not been unloaded.
  192.  
  193.                 Usage -- CLI:  Opt KZ
  194.                          TOOL TYPES:    KILL=TRUE
  195.                               ZAP=TRUE
  196.  
  197.  
  198. "b=rate"  (BAUD=RATE)    Sets the serial hardware baud rate.  This option is
  199.             ignored if Parallel or Local output is requested.
  200.             The baud rate is determined by the last value stored
  201.             in the serper register. When you boot your system,
  202.             the hard ware is set to 9600 baud.  If you use the
  203.             serial.device or SER: before using WEDGE, the serper
  204.             (serial period) register may contain a different
  205.             rate.  Use this option to reset the baud rate for
  206.             WEDGE.  If run from CLI, the b option without a
  207.             specified rate will set 9600 baud.  If you also use
  208.             the d option to enter ROMWACK, you must use 9600
  209.             baud since ROMWACK forces 9600.  Use quotes if you
  210.             are passing this parameter to a script.
  211.  
  212.  
  213. "c=text" (COMMENT="text") Allows you to include a comment with each report.
  214.              The comment is generally the name and register
  215.              argument descriptions for the function being
  216.              WEDGEd.  From CLI, quotes must be used around the
  217.              entire C= string if the comment contains spaces.
  218.              If entered from the Workbench, everything to the
  219.              right of the = sign should be in quotes.  The WEDGE
  220.              comments are displayed when you do a WEDGE List. If
  221.              a WEDGE has no comment, its offset and library will
  222.              be listed.
  223.  
  224.                               Usage -- CLI:       "c=AvailMem d1=Type"
  225.                                        TOOL TYPE: COMMENT="AvailMem d1=Type"
  226.  
  227.  
  228. d=n    (DEBUG=n)    Causes a call to Debug() on the nth reported call of
  229.             the WEDGEd function.  (This option is only valid in
  230.             a serial WEDGE.)  By default, Debug() invokes the
  231.             system's built-in 9600 baud serial debugger ROMWACK.
  232.             Since ROMWACK forces 9600 baud, you should only use
  233.             this option in a 9600 baud WEDGE (unless you have a
  234.             resident serial debugger that works at other baud
  235.             rates).
  236.  
  237.             If Result reporting (opt r) is in effect, the call
  238.             to Debug() will be made AFTER the WEDGEd function
  239.             has been called and its result reported.  If Result
  240.             reporting is not on, Debug() will be called after
  241.             the normal WEDGE report and immediately before WEDGE
  242.             actually calls the function.  This allows you to
  243.             enter the debugger either before or after the WEDGEd
  244.             function has been called.  In both cases, you will
  245.             enter the debugger with all of the function caller's
  246.             registers intact, except for a6 which will contain
  247.             ExecBase.  The first two values on the stack will be
  248.             the return address for Debug() and the caller's a6.
  249.  
  250.             When you exit the debugger, you will be prompted
  251.             "Debug again <y or n>?" at the serial terminal.  By
  252.             entering 'y', you can Debug successive calls to the
  253.             WEDGEd function.  Note that Debug will not be
  254.             invoked if the caller is running on the system stack
  255.             because the caller may be an interrupt.
  256.  
  257.             You will also be asked whether you wish to Wait
  258.             the calling task.  If you say yes, the calling task
  259.             will be placed in a  Wait for CTRL-C.  You can
  260.             then use local debugging tools to examine memory.
  261.             When you are ready to restart the calling task,
  262.             you can use BREAK to restart the task (if it
  263.             was started from CLI) or the Software Tools
  264.             "breaktask" command to send a CTRL-C to any
  265.             named Exec task or CLI command.
  266.  
  267.             When run from the CLI, the d option used without an
  268.             argument is equivalent to "d=1."
  269.  
  270.                 Usage -- CLI:          "d=6" or opt d
  271.                                             TOOL TYPE:    DEBUG=1
  272.  
  273.  
  274. "t=tasklist"        Limits reporting to the tasks named in Tasklist.
  275. (TASKS="tasklist")      This is useful for monitoring the function calls of
  276.             a particular task or group of tasks.  If the x
  277.             option (EXCLUDE) is used, the tasks in the tasklist
  278.             are instead excluded from reporting.  This is
  279.             useful for screening out any Amiga OS tasks that
  280.             make heavy use of the function being monitored.
  281.  
  282.             The tasklist should be in quotes, and multiple task
  283.             names should be separated by a vertical bar.  WEDGE
  284.             will compare the tasklist names against both Task
  285.             node names and the command name of any CLI invoked
  286.             command which calls the WEDGEd function.
  287.  
  288.             WEDGE also recognizes two special task names:
  289.  
  290.                 System: Matches any code running on system
  291.                     stack (interrupts, etc.).
  292.  
  293.                 All: If this is the only task name in the
  294.                      list, the list is ignored.  This allows
  295.                      you to disable the TASKS TOOL TYPE
  296.                      without removing it from the .info file.
  297.  
  298.                 Usage -- CLI:          "t=System|CON|wedge"
  299.                              TOOL TYPE: TASKS="System|CON|wedge"
  300.  
  301.  
  302. EXAMPLE WEDGE COMMAND LINES
  303.  
  304. Note - by default, when LVO generates a wedge command line for you,
  305. it will tell wedge you want to see the result (opt r) and also that
  306. you want to see what all address register arguments and a7 point to.
  307. But dos.library often uses a data register such as d1 to pass name
  308. arguments.  You probably want to see such name arguments (and not
  309. just their addresses), so after generating a wedgeline with LVO,
  310. you may wish to edit the 3rd hex parameter (the show me what these
  311. registers point at parameter) to set the bit for the data register
  312. in which the name is passed.  For example, the Open and Lock examples
  313. below, as generated by LVO, were:
  314.  
  315. run wedge dos 0xffe2 0x8006 0x8000 opt r   "c=Open(name,accessMode)(d1/d2)"
  316. run wedge dos 0xffac 0x8006 0x8000 opt r   "c=Lock(name,type)(d1/d2)"
  317.                                  ^bits for d3 d2 d1 d0
  318.  
  319. But we have changed these by setting the bit for d1 in the third
  320. hex parameter, so wedge will show us the data pointed at by d1:
  321.  
  322. run wedge dos 0xffe2 0x8006 0x8002 opt r   "c=Open(name,accessMode)(d1/d2)"
  323. run wedge dos 0xffac 0x8006 0x8002 opt r   "c=Lock(name,type)(d1/d2)"
  324.  
  325. The following examples were all generated with LVO, but we edited
  326. the Open and Lock examples as described previously.
  327.  
  328. DOS Examples:
  329.  
  330. run wedge dos 0xffe2 0x8006 0x8002 opt r   "c=Open(name,accessMode)(d1/d2)"
  331. run wedge dos 0xffdc 0x8002 0x8000 opt r   "c=Close(file)(d1)"
  332. run wedge dos 0xffac 0x8006 0x8002 opt r   "c=Lock(name,type)(d1/d2)"
  333. run wedge dos 0xffa6 0x8002 0x8000 opt r   "c=UnLock(lock)(d1)"
  334. run wedge dos 0xffa0 0x8002 0x8000 opt r   "c=DupLock(lock)(d1)"
  335.  
  336. Memory Examples:
  337.  
  338. run wedge exec 0xff3a 0x8003 0x8000 opt r   "c=AllocMem(byteSize,requirements)(d0/d1)"
  339. run wedge exec 0xff2e 0x8201 0x8200 opt r   "c=FreeMem(memoryBlock,byteSize)(a1,d0)"
  340. run wedge exec 0xfd54 0x8003 0x8000 opt r   "c=AllocVec(byteSize,requirements)(d0/d1)"
  341. run wedge exec 0xfd4e 0x8200 0x8200 opt r   "c=FreeVec(memoryBlock)(a1)"
  342.  
  343. Other Exec Examples:
  344.  
  345. run wedge exec 0xfe44 0x8303 0x8300 opt r   "c=OpenDevice(devName,unit,ioRequest,flags)(a0,d0/a1,d1)"
  346. run wedge exec 0xfe3e 0x8200 0x8200 opt r   "c=CloseDevice(ioRequest)(a1)"
  347. run wedge exec 0xfdd8 0x8201 0x8200 opt r   "c=OpenLibrary(libName,version)(a1,d0)"
  348. run wedge exec 0xfe62 0x8200 0x8200 opt r   "c=CloseLibrary(library)(a1)"
  349.  
  350. Intuition Examples:
  351.  
  352. run wedge intuition 0xff34 0x8100 0x8100 opt r   "c=OpenWindow(newWindow)(a0)"
  353. run wedge intuition 0xffb8 0x8100 0x8100 opt r   "c=CloseWindow(window)(a0)"
  354. run wedge intuition 0xff3a 0x8100 0x8100 opt r   "c=OpenScreen(newScreen)(a0)"
  355. run wedge intuition 0xffbe 0x8100 0x8100 opt r   "c=CloseScreen(screen)(a0)"
  356. run wedge intuition 0xfda2 0x8300 0x8300 opt r   "c=OpenWindowTagList(newWindow,tagList)(a0/a1)"
  357. run wedge intuition 0xfd9c 0x8300 0x8300 opt r   "c=OpenScreenTagList(newScreen,tagList)(a0/a1)"
  358.  
  359. Icon examples:
  360.  
  361. run wedge icon 0xffb2 0x8100 0x8100 opt r   "c=GetDiskObject(name)(a0)"
  362. run wedge icon 0xffa6 0x8100 0x8100 opt r   "c=FreeDiskObject(diskobj)(a0)"
  363. run wedge icon 0xffac 0x8300 0x8300 opt r   "c=PutDiskObject(name,diskobj)(a0/a1)"
  364. run wedge icon 0xffa0 0x8300 0x8300 opt r   "c=FindToolType(toolTypeArray,typeName)(a0/a1)"
  365.  
  366.  
  367.  
  368. RUNNING WEDGE FROM THE WORKBENCH
  369.  
  370. You could make a Tool icon for Wedge, and/or Project icons with the
  371. Default Tool of Wedge if you want to use Wedge from Workbench.
  372.  
  373. When WEDGE is run directly from the Workbench, the TOOL TYPES entries in the
  374. icon's INFO window determine which library and offset to monitor and which
  375. options are enabled/disabled.  To change an entry or add an option that is
  376. not listed, use the Workbench INFO function.  To bring up the INFO window,
  377. select a Wedge icon, then select the INFO option in the Workbench's first
  378. menu (the Workbench menu).  Use the scroll arrows, the add/delete gadgets,
  379. and the key board to add, delete or modify the icon's TOOL TYPE entries.
  380.  
  381. The acceptable format for TOOL TYPES entries was included in the explanation
  382. of each option.  The TOOL TYPES default to:
  383.  
  384.     AmigaDOS argument        TOOL TYPE Default
  385.  
  386.     <regs>                 REGS=0x0000
  387.     <ptrs>                PTRS=0x0000
  388.     l                LOCAL=FALSE
  389.     p                PARALLEL=FALSE
  390.     r                RESULT=FALSE
  391.     a                RESULTP=FALSE
  392.     s                STACK=FALSE
  393.     x                EXCLUDE=FALSE
  394.     "t=tasklist"            TASKS=ALL
  395.  
  396. There are no default values for the library and offset arguments. These
  397. values MUST be supplied.
  398.  
  399.  
  400.  
  401. SPECIAL WEDGE FUNCTIONS
  402.  
  403. The following functions can be specified with a single CLI argument, a TOOL
  404. TYPES entry, or simply by double-clicking on the corresponding icon in the
  405. WEDGE window.
  406.  
  407. CLI Command        TOOL TYPES    Icon        Function
  408.  
  409. WEDGE help        HELP=TRUE    Wedge.Help    Lists WEDGE
  410.                             arguments, TOOL
  411.                             TYPES, and notes.
  412.  
  413. WEDGE killall        KILLALL=TRUE    Wedge.KillAll    Signals all WEDGEs
  414.                             to remove
  415.                             themselves. If no
  416.                             WEDGEs are currently
  417.                             installed, this
  418.                             option will remove
  419.                             and deallocate the
  420.                             resident
  421.                             "WedgeMaster"
  422.                             Message Port which
  423.                             holds some global
  424.                             information for the
  425.                             WEDGEs.
  426.  
  427. WEDGE list        LIST=TRUE    Wedge.List    Lists all WEDGEs
  428.                             currently installed.
  429.  
  430.  
  431. WEDGE LIMITATIONS
  432.  
  433. Due to the need for WEDGE to be fast and small and to call as few library
  434. functions as possible, there are certain arbitrary limitations.
  435.  
  436. 1.  The Exec functions RawIOInit, RawDoFmt, RawMayGetChar, and RawPutChar()
  437.     may not be WEDGEd because they are called indirectly by the WEDGE itself.
  438.     If these functions were WEDGEd, a recursive loop would occur.  WEDGE
  439.     caches pointers to Forbid and Permit.  Installed WEDGEs call these
  440.     functions using these pointers, so these functions may be WEDGEd.
  441.  
  442. 2.  To help prevent such recursive loops in Local mode, function calls made
  443.     by the Local output handler are not reported.  Unless CLI output
  444.     redirection has been used, the Local handler is a CON: window.  All
  445.     function calls made by the standard Amiga Exec devices are automatically
  446.     screened out in Local mode, since our devices are not Processes.
  447.     However, be warned that if you redirect Local output to a third party
  448.     handler or device, a recursive loop (and big crash) can occur.
  449.  
  450. 3.  There are size limits for several WEDGE arguments:
  451.  
  452.         tasklist    31 task names; 319 characters
  453.         library        39 characters
  454.         comment        79 characters
  455.  
  456. 4.  The maximum size for KILLALL and LIST is 127 WEDGEs.
  457.  
  458. 5.  The CLI command names specified in the tasklist option must be 16
  459.     characters or less.  If you want to monitor or exclude a command with a
  460.     larger name, rename it.  There is no limit on the size of normal Exec
  461.     Task names in the tasklist.
  462.  
  463.  
  464.  
  465. WARNINGS
  466.  
  467. 1.  In some cases, the caller of a WEDGEd function may have so little
  468.     available stack that the WEDGE code to save the caller's registers and
  469.     to check his stack may overrun it.  If this happens, severe crashes can
  470.     occur. Use the tasklist to screen out tasks with tiny stacks.
  471.  
  472. 2.  WEDGE contains a number of safety features to prevent recursion.
  473.     However, the possibility of recursive crashes still exists, most notably
  474.     in Local mode.  See the note on Local recursion in "WEDGE Limitations."
  475.  
  476. 3.  When creating masks for REGS and PTRS, do not indiscriminately specify
  477.     registers as pointers.  Only specify a register as a pointer if the
  478.     address of a string, structure, buffer, etc. is actually passed in that
  479.     register. If a register is specified as a pointer, its contents will be
  480.     used as an ad dress and the data at that address will be read.  If the
  481.     register actually contains flags or other non-address data, you could
  482.     end up reading registers which are reset by a read.  This could cause a
  483.     crash.
  484.  
  485. 4.  If you WEDGE common Exec functions, such as AllocMem() and Signal(),
  486.     with out excluding low level OS tasks such as input.device and
  487.     trackdisk.device, the system will slow to a crawl.  It is strongly
  488.     suggested that you do not write to disks while an intensive WEDGE is
  489.     running.  (It would take forever anyway.)
  490.  
  491.  
  492.  
  493. SAMPLE WEDGE COMMANDS AND RESULTING OUTPUT
  494.  
  495. NOTE:  Normally you would set up a ".w" script and/or icon to install a
  496.        WEDGE.
  497.  
  498. Example 1.
  499.  
  500. WEDGE exec.library AvailMem function (oxff28) with Stack reporting (OPT S).
  501. Only report on calls made by Workbench or the CLI command AVAIL.
  502.  
  503. Enter:
  504.  
  505. 1> run Toolkit:Debug/Wedge/WEDGE exec 0xff28 opt s "c=AvailMem d1=Type"
  506. "t=Workbench|Avail"
  507.  
  508. Sample WEDGE Output:
  509.  
  510. ----------------------------------------------------------------------------
  511. AvailMem d1=Type
  512. COMMAND: Avail    PROCESS: Initial CLI ($203798) [F]
  513. Pre-wedge a7=$232D7C  Task Stack:  Lower=$203854, Upper=$203E94
  514. Command Stack: Base at startup=$232DF8, Size=10000
  515.  
  516. AvailMem d1=Type
  517. PROCESS:  Workbench ($20FB40)
  518. Pre-wedge a7=$210F14   Task Stack: Lower=$20FBFC, Upper=$210F84
  519. ----------------------------------------------------------------------------
  520.  
  521. When a CLI command calls the WEDGEd function, the COMMAND name is reported.
  522. In addition, if Stack reporting has been requested, both the PROCESS and the
  523. separate COMMAND stack are reported.  Also note the "[F]" in one of the
  524. reports.  This means the task calling the function had a Forbid() in effect.
  525. A Disable() would have been reported as "[D]", both as "[FD]".
  526.  
  527.  
  528. Example 2
  529.  
  530. WEDGE dos.library Open function (offset 0xffe2), report registers d1 and d2
  531. (0x0006).  Report what d1 points at (0x0002), and report both Result (opt r)
  532. and Stack (opt s).
  533.  
  534. Enter:
  535.  
  536. 1> run Toolkit:Debug/Wedge/WEDGE dos 0xffe2 0x0006 0x0002 opt rs "c=Open
  537. d1=Name d2=Mode"
  538.  
  539. Sample WEDGE Output when Workbench calls Open (".info",MODE_NEWFILE):
  540.  
  541. ----------------------------------------------------------------------------
  542. Open d1=Name d2=Mode
  543. PROCESS: Workbench ($20FB40)
  544. d1 $00FECD60 ->  $2E696E66  6F005359   533A5379  7374656D .info.SYS:System
  545. d2 $000003EE
  546. Pre-wedge a7=$210DFC   Task Stack: Lower=$20FBFC, Upper=$210F04
  547. Result ID=6
  548. Result: $86EB9  (ID=6)
  549. ----------------------------------------------------------------------------
  550.  
  551. In the ASCII dump at the right, all unprintable values, such as the 0
  552. terminating the ".info" filename, are printed as a period (".").  All
  553. output lines except the "PROCESS" line are optional and are requested via
  554. CLI arguments or TOOL TYPES.
  555.  
  556. The OpenWindow.w, Open.w, and AvailMem.w icons have been provided for
  557. wedging common system functions.  OpenWindow.w installs a WEDGE into $FF34
  558. of the intuition.library; Open.w installs a WEDGE into $FFE2 of the
  559. dos.library; and AvailMem.w installs a WEDGE into $FF28 of the exec.library.
  560. These projects can be run through the Workbench.  To change any of the
  561. parameters, change the TOOL TYPES entries in the icon's Info window.
  562.  
  563. The icons are set up for Local output.  The scripts are set up for default
  564. (serial) output with no baud rate specified.  To use serial scripts for
  565. Local or Parallel debugging, pass the appropriate flag when you execute the
  566. script.  In order for Execute to find the scripts, you must cd where they
  567. are or copy them to your s: directory.  Here are some examples of passing
  568. options to the AvailMem.w script:
  569.  
  570. execute AvailMem.w prs    (prs = Parallel, Result reports, Stack reports)
  571. execute AvailMem.w l    (l = Local)
  572. execute AvailMem.w dr    (dr = Debug on first call, Result reports)
  573.  
  574.  
  575.  
  576. CREATING YOUR OWN WEDGE SCRIPTS AND ICONS
  577.  
  578. NEW - The new LVO command's "wedgeline" option can be used with the Amiga
  579. FD files to automatically create command lines for WEDGE.  This is the
  580. easiest way to create a basic command line for WEDGE - much easier than
  581. figuring out the register bit patterns yourself.  Use LVO to create and
  582. redirect a basic wedge line to a file, then edit the file to change or
  583. add additional options.  LVO requires the assignment FD: to where you have
  584. stored the FD files.
  585.  
  586. Example:  LVO >s:availmem.w exec AvailMem wedgeline
  587.           will create a script called availmem.w which contains:
  588. run wedge exec 0xff28 0x8002 0x8000 opt r   "c=AvailMem(requirements)(d1)"
  589.  
  590. By executing the above script, you will wedge into the exec
  591. AvailMem function for all tasks, default serial output, with
  592. result values (opt r) shown.
  593.  
  594. To create additional WEDGE icons, duplicate an existing icon, then go into
  595. the icon's INFO window to modify the TOOL TYPES arguments.
  596.  
  597. Each icon is attached to a ".w" script file, so you should use ED or MEMACS
  598. to modify the script file attached to your icon.  If you do not, the script
  599. file will not install the desired WEDGE from CLI since it will be a
  600. duplicate of the script attached to the icon you copied.
  601.  
  602. Offsets for all system library functions may be found in the Addison-Wesley
  603. ROM Kernel Reference Manual:  Includes and Autodocs.  The manual contains
  604. several representations of each offset.  Use the hex form that starts with
  605. "0xf".  Or use the LVO command with the FD files to automatically
  606. generate LVO's or WEDGE command lines.
  607.  
  608.  
  609.